package com.tuo51.childcare.domain.expertroom;

import com.tuo51.foudation.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 每日观察记录
 */
@Entity
@Table(name = "user_expert_hint")
@EqualsAndHashCode(callSuper = true)
@Data
public class ExpertHint extends Domain {

    @Column(columnDefinition = "varchar(32) COMMENT '用户id'")
    private String uid;

    @Column(columnDefinition = "varchar(32) COMMENT '孩子id'")
    private String childrenId;

    @Column(columnDefinition = "varchar(32) COMMENT '报告id'")
    private String reportId;

    @Column(columnDefinition = "varchar(256) COMMENT '诊室id'")
    private String roomId;

    @Column(columnDefinition = "varchar(128) COMMENT '提示内容'")
    private String hint;

    @Column(columnDefinition = "varchar(128) COMMENT '子提示内容'")
    private String subHint;

    @Column(columnDefinition = "varchar(256) COMMENT '封面图片'")
    private String cover;

    @Column(columnDefinition = "int(3) COMMENT '类型'")
    private Integer type = 0;

    @Column(columnDefinition = "bit(1) COMMENT '是否已读'")
    private Boolean readed;


    public static ExpertHint of(Integer type, String reportId, String hint, String subHint, String cover, boolean read){
        ExpertHint ret = new ExpertHint();

        ret.setReportId(reportId);
        ret.setHint(hint);
        ret.setSubHint(subHint);
        ret.setCover(cover);
        ret.setReaded(read);
        ret.setType(type);

        return ret;
    }
}
